package luj.game.robot.internal.net.receive;

import luj.cluster.api.actor.Tellable;
import luj.game.robot.api.action.CommandService;
import luj.game.robot.api.action.RobotBossCommand;
import luj.game.robot.api.network.RobotProtoHandler;
import luj.game.robot.internal.concurrent.parent.RobotBossDependency;
import luj.game.robot.internal.instance.boss.command.service.BossServiceFactory;

final class SBossProto implements RobotProtoHandler.Boss {

  @Override
  public <P> CommandService<P> command(Class<? extends RobotBossCommand<P>> cmdType) {
    RobotBossDependency d = _dependency;
    return new BossServiceFactory(_bossRef, d.getLujbean(), d.getCommandMap(), cmdType).create();
  }

  Tellable _bossRef;

  RobotBossDependency _dependency;
}
